package com.vatsalya.bakthi.yoga.broadcastreceivers;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.vatsalya.bakthi.yoga.R;

public class TimeAlarm extends BroadcastReceiver {

	NotificationManager nm;

	@Override
	public void onReceive(Context context, Intent intent) {
		nm = (NotificationManager) context
				.getSystemService(Context.NOTIFICATION_SERVICE);
		String from = "Bakthi Yoga";
		String message = intent.getExtras().getString("message");
		PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
				new Intent(), 0);
		Notification notif = new Notification(R.drawable.ic_launcher, message, System.currentTimeMillis());
		notif.setLatestEventInfo(context, from, message, contentIntent);
		notif.defaults = Notification.DEFAULT_ALL;
		nm.notify(1, notif);
	}
}
